import re

file_name = "SP_out.txt"
out_txt = "simlink.txt"
f = open(file_name, 'r', encoding="UTF-8")
r = open(out_txt, 'w', encoding="UTF-8")

mar = r'[%]{1}[ ]?[A-Za-z0-9_]+'
i = 1
for mal in f.readlines():
    line = re.findall(mar, mal)
    name = line[0].replace('% ', '')
    write = '"'+str(i)+'": {},\n'
    i += 1
    r.write(write)
    r.flush()
    #print(name)



